package carmensd.vista.expedienteYvillanos

import applicationModel.EditarSeniasVillanoAppModel
import org.uqbar.arena.layout.VerticalLayout
import org.uqbar.arena.widgets.Button
import org.uqbar.arena.widgets.Label
import org.uqbar.arena.widgets.List
import org.uqbar.arena.widgets.Panel
import org.uqbar.arena.widgets.TextBox
import org.uqbar.arena.windows.Dialog
import org.uqbar.arena.windows.WindowOwner

class EditarSeniasWindow extends Dialog<EditarSeniasVillanoAppModel> {

	new(WindowOwner parent, EditarSeniasVillanoAppModel model) {
		super(parent, model)
	}

	override createContents(Panel panel) {
		this.setTitle("Editar Señas Particulares")
		panel.setLayout(new VerticalLayout)

		new Label(panel).setText("Señas:")
		new List(panel) => [
			bindItemsToProperty("villanoEnEdicion.seniasParticulares")
			bindValueToProperty("seniaSeleccionada")
		]

		new Button(panel) => [
			caption = "Eliminar"
			onClick [|modelObject.eliminarSenia]
		]

		new TextBox(panel).bindValueToProperty("seniaAAgregar")
		new Button(panel) => [
			caption = "Agregar"
			onClick [|modelObject.agregarSenia]
		]

	}

	override protected createFormPanel(Panel mainPanel) {
		throw new UnsupportedOperationException("TODO: auto-generated method stub")
	}
}
